import Vue from 'vue'
import VueRouter from 'vue-router'
import firstpage from '../views/page/FirstPag.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/firstpage',
    component: firstpage
  },
  {
    // 我的音乐
    path: '/mymusic',
    component: () => import('../views/page/MyMusic.vue')
  },
  {
    // 关注
    path: '/concern',
    component: () => import('../views/page/MyConcern.vue')
  },
  {
    path: '/songsdata',
    component: () => import('../views/page/listdata/SongsData.vue')
  },
  {
    name:'playsong',
    path: '/playsong/:id',
    component: () => import('../views/page/listdata/PlaySong.vue')
  },
  // 重定向
  {
    path: '*',
    redirect: '/firstpage'
  }
]

const router = new VueRouter({ 
  mode: 'history',
  // base:"/pages",
  base: process.env.BASE_URL,
  routes
})

export default router
